package com.kaka.bus.adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kaka.bus.R;
import com.kaka.bus.bean.InviteBean;

import java.util.List;

/**
 * Created by OnionMac on 2018/4/17.
 */

public class InviteAdapter extends BaseQuickAdapter<InviteBean,BaseViewHolder> {

    public InviteAdapter(int layoutResId, @Nullable List<InviteBean> data) {
        super(layoutResId, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, InviteBean item) {

        if(helper.getAdapterPosition() % 2 == 1){
            helper.itemView.setBackgroundColor(Color.WHITE);
        }else{
            helper.itemView.setBackgroundColor(Color.parseColor("#fbe1e0"));
        }

        helper.setText(R.id.item_invite_stage,item.getTrackingStatus())
                .setText(R.id.item_invite_money,item.getCommission())
                .setText(R.id.item_invite_phone,item.getPhone())
                .setText(R.id.item_invite_type,item.getType());
    }
}
